home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / utmisc1 / ovr50711.lha / Over5 / doc / boot.tech < prev    next >
Text File  |  1996-05-12  |  4KB  |  112 lines

  1. boot.tech
  2. ---------
  3. Copyright (c) 1995,1996 Daniel Kahlin <tlr@stacken.kth.se>
  4.  
  5. (last changed 960415)
  6.  
  7. ---------------------------------------------------------------------------
  8. Over5 old boot protocol specification
  9. by Daniel Kahlin <tlr@stacken.kth.se>
  10.  
  11. Purpose:  To transfer an arbitrary program to a C64.
  12.  
  13. Over5 in boot mode starts with sending sync.  It consists of 6 'S' bytes
  14. sent with a 0.3 second delay in between.  After this the start and end
  15. addresses are sent.  Then the data follows, and last a checksum.
  16. The addition between all bytes excluding sync must end up to be 0. (if 
  17. anded with $ff)
  18.  
  19. The actual data transferred are:
  20.  $c000-len to $c000  : the program specified 
  21.  $c000  to $c0xx     : the copytail
  22.  
  23. When all data has been transferred ok, just jump to the copytail and it
  24. will move the data down to basic memory and prompt you to save it.
  25.  
  26. This is the old boot program 'bootold.asc'
  27.  
  28. ---
  29.  
  30. 100 OPEN2,2,3,CHR$(5)+CHR$(0)
  31. 110 PRINT"WAITING..."
  32. 120 GOSUB 400:IF A$<>"S" THEN 120
  33. 130 GOSUB 400:IF A$="S" THEN 130
  34. 140 C=A:I=A:GOSUB 400:I=I+A*256
  35. 150 GOSUB 400:E=A:GOSUB 400:E=E+A*256
  36. 160 GOSUB 400:PRINT"*";:POKEI,A:I=I+1:IF I<>E THEN 160
  37. 170 GOSUB 400:IF C<>0 THEN PRINT:PRINT"?CHK ERROR":CLOSE2:END
  38. 180 PRINT:PRINT"CHK OK":CLOSE2:END
  39. 400 GET#2,A$:IF ST=8 THEN 400
  40. 410 IF A$="" THEN A$=CHR$(0)
  41. 420 A=ASC(A$):C=(C+A)AND255:RETURN
  42.  
  43. ---
  44.  
  45. the copytail source is in Over5/6502/copytail64.asm
  46.  
  47. /END
  48.  
  49. ---------------------------------------------------------------------------
  50. Over5 new boot protocol specification
  51. by Daniel Kahlin <tlr@stacken.kth.se>
  52.  
  53. Purpose:  To transfer an arbitrary program to any cbm 8-bit computer.
  54.  
  55. The new boot works like a two stage rocket.  The first stage (the basic
  56. program) just reads the real boot program into memory.
  57. To be able to use it with the VIC-20 and to simplify the program, the data
  58. sent to the basic program may not contain any 0 bytes.  This means we need
  59. the real boot program to 'unpack' itself. (and maybe relocate)  It also
  60. means we have to have two checksum bytes.   To simplify even more the
  61. addresses in memory are fixed.  512 bytes are always transferred including
  62. the checksum bytes.  Addresses $1770 (6000) to $196f (6511) should work on
  63. all configurations of the VIC-20, and the C-64.  Please note that the code
  64. is completely relocatable, i.e you could select another address space like
  65. $c000 to $c1ff.  The code is machine independant and will probably work on
  66. a PET and a PLUS/4, etc... Please notify me with your results if you test
  67. it.  To get rid of 0 bytes we find a byte that is not used at all in the
  68. 'booter', and translate every occurance of 0 to that byte.  (there are a
  69. lot of bytes that occur zero times.)
  70.  
  71. First we send the booter at 150 baud.  Start with a sync (6 'S' bytes
  72. followed by an 'E'), then follows 512 bytes of data.  The sum of all bytes
  73. MUST be zero.  When done we 'sys' the code, which then 'unpacks' and
  74. relocates to MEMTOP-$420. (When the code later opens an RS232 file, kernal
  75. lowers MEMTOP by $200 for buffers)
  76.  
  77. Second we send the data at 600 baud.  Start with a sync (6 'S' bytes
  78. followed by an 'E'), To get rid of 0 bytes this time we encode $11 as
  79. $11,$11 and $00 as $11,$80.  As end marker we us $11,$01.  The data
  80. is received from MEMBOT+1 and up ($0801 on a stock c64).  When the end
  81. marker is encountered two more bytes are read, (but not stored) these are
  82. the checksum bytes.  The sum of all received bytes excluding sync MUST be
  83. 0.
  84.  
  85. After all is transferred the user gets the message 'OK, NOW SAVE TO DISK!'
  86. and a 'READY.' prompt.  At this point the basic end pointers $2d/$2e has
  87. been set, thus a 'SAVE' command will save the program.
  88.  
  89. This is the new boot program 'boot.asc'
  90. (please note that you cannot simplify the two 'CLOSE 2' statements
  91.  to a single one in line 185, because closing an RS232 file does
  92.  a 'CLR' command.)
  93. ---
  94.  
  95. 100 OPEN2,2,3,CHR$(5)+CHR$(0)
  96. 110 PRINT"WAITING..."
  97. 120 GET#2,A$:IF A$<>"S" THEN 120
  98. 130 GET#2,A$:IF A$="S" OR A$="" THEN 130
  99. 140 FOR I=6000 TO 6511
  100. 150 GET#2,A$:IF A$="" THEN 150
  101. 160 A=ASC(A$):C=(C+A)AND255
  102. 170 POKE I,A:PRINT "#";
  103. 180 NEXT
  104. 190 IF C<>0 THEN PRINT:PRINT"?CHK ERROR":CLOSE2:END
  105. 200 CLOSE2:SYS 6000
  106.  
  107. ---
  108.  
  109. the booter source is in Over5/6502/booter.asm
  110.  
  111. /END
  112.